<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>学生管理</title>
  </head>
  
  <body>
      <h3>学生管理</h3><br/>
      <a href="<%=basePath%>student/studentAction_addStudent.action">新增</a>
      <table border="1" cellpadding="0" cellspacing="0">
      	<tr>
      	   <td width="100" align="center">学号</td>
      	   <td width="100" align="center">姓名</td>
      	   <td width="100" align="center">性别</td>
      	   <td width="100" align="center">年龄</td>
      	   <td width="100" align="center">操作</td>
      	</tr>
      	<!--------------------- forEach Begin ----------->
		<c:forEach items="${list }" var="student" >		
			<tr>
				<td width="100" align="center">					 
					${student.sid}
				</td>
				<td width="100" align="center">
					${student.name}
				</td>
				<td width="100" align="center">
					<c:if test="${student.sex==1}">男</c:if>
					<c:if test="${student.sex==0}">女</c:if>
				</td>
				<td width="100" align="center">
					${student.age}
				</td>
				<td width="100" align="center">
					<a href="<%=basePath%>student/studentAction_getStudent.action?sid=${student.sid}">修改</a>
					<a href="<%=basePath%>student/studentAction_delete.action?sid=${student.sid}">删除</a>
				</td>
			</tr>						
		</c:forEach>
		<!--------------------- foreach end -----------> 	
      </table>
  </body>
</html>
